package com.hua.designpattern.behavioral.nullobject;

public class ObjectFactory {

	private static final String[] allowNames = { "name1", "name2", "name3" };

	public static AbstractObject getCustomer(String name) {
		for (int i = 0; i < allowNames.length; i++) {
			if (allowNames[i].equalsIgnoreCase(name)) {
				return new ConcreteObject(name);
			}
		}
		return new NullObject();
	}
}
